<!DOCTYPE html>
<html>
  <head>
    <title>Listing 14.10</title>
    <meta charset="utf-8">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <script type="text/javascript">

      function remove() {
        // Go through all descendants and the element to be removed
        jQuery("*", this).add([this]).each(function () {
          // Remove all bound events
          jQuery.event.remove(this);

          // Remove attached data
          jQuery.removeData(this);
        });

        // Remove the element (if it's in the DOM)
        if (this.parentNode)
          this.parentNode.removeChild(this);
      }

    </script>
  </body>
</html>
